package c.e.a.b.f.b;

import android.os.RemoteException;
import android.text.TextUtils;
import com.google.android.gms.measurement.internal.zzn;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class f8 implements Runnable {
    public final /* synthetic */ AtomicReference a;
    public final /* synthetic */ String b;
    public final /* synthetic */ String c;
    public final /* synthetic */ String d;
    public final /* synthetic */ zzn e;
    public final /* synthetic */ q7 f;

    public f8(q7 q7Var, AtomicReference atomicReference, String str, String str2, String str3, zzn zzn) {
        this.f = q7Var;
        this.a = atomicReference;
        this.b = str;
        this.c = str2;
        this.d = str3;
        this.e = zzn;
    }

    public final void run() {
        synchronized (this.a) {
            try {
                q7 q7Var = this.f;
                i3 i3Var = q7Var.d;
                if (i3Var == null) {
                    q7Var.d().f.d("(legacy) Failed to get conditional properties; not connected to service", q3.s(this.b), this.c, this.d);
                    this.a.set(Collections.emptyList());
                    this.a.notify();
                    return;
                }
                if (TextUtils.isEmpty(this.b)) {
                    this.a.set(i3Var.H0(this.c, this.d, this.e));
                } else {
                    this.a.set(i3Var.F0(this.b, this.c, this.d));
                }
                this.f.F();
                this.a.notify();
            } catch (RemoteException e) {
                try {
                    this.f.d().f.d("(legacy) Failed to get conditional properties; remote exception", q3.s(this.b), this.c, e);
                    this.a.set(Collections.emptyList());
                    this.a.notify();
                } catch (Throwable th) {
                    this.a.notify();
                }
            }
        }
    }
}
